---
title: JSON files as database, on Google Cloud Storage (GCS)
sidebarTitle: GCS
---

Agno supports using [Google Cloud Storage (GCS)](https://cloud.google.com/storage) as a database with the `GcsJsonDb` class.
Session data will be stored as JSON blobs in a GCS bucket.

You can get started with GCS following their [Get Started guide](https://cloud.google.com/docs/get-started).

## Usage

```python gcs_for_agent.py
import uuid
import google.auth
from agno.agent import Agent
from agno.db.gcs_json import GcsJsonDb

# Obtain the default credentials and project id from your gcloud CLI session.
credentials, project_id = google.auth.default()

# Generate a unique bucket name using a base name and a UUID4 suffix.
base_bucket_name = "example-gcs-bucket"
unique_bucket_name = f"{base_bucket_name}-{uuid.uuid4().hex[:12]}"
print(f"Using bucket: {unique_bucket_name}")

# Initialize GCSJsonDb with explicit credentials, unique bucket name, and project.
db = GcsJsonDb(
    bucket_name=unique_bucket_name,
    prefix="agent/",
    project=project_id,
    credentials=credentials,
)

# Setup your Agent with the Database
agent = Agent(db=db)
```

## Params

<Snippet file="db-gcs-params.mdx" />

## Developer Resources

- View [Cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/db/gcs/gcs_json_for_agent.py)
- see full example [here](/examples/concepts/db/gcs/gcs_for_agent)